package com.cong.outlets.controller;

import com.cong.outlets.dto.OutletsLensDto;
import com.cong.outlets.entity.Outlets;
import com.cong.outlets.service.OutletsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author cong
 * @since 2023/10/20 14:10
 */
@RestController
@RequestMapping("outlets")
public class OutletsController {

    @Autowired
    private OutletsService outletsService;

    /**
     * GET http://localhost:8080/outlets/listLens?outletsId=1
     * @param outletsId
     * @return
     */
    @GetMapping("listLens")
    public OutletsLensDto get(@RequestParam Long outletsId) {
        return outletsService.getById(outletsId);
    }
}
